package com.okRPC.balancer;

import com.okRPC.common.ServiceInfo;

import java.util.List;
import java.util.Random;

/**
 * Description: This is a sample class.
 * Author: Simon
 * Date: 2023/10/10
 */
public class RandomLoadBalance implements LoadBalance{

    private static Random random = new Random();

    @Override
    public ServiceInfo chooseOne(List<ServiceInfo> services) {
        return services.get(random.nextInt(services.size()));
    }

}
